import React, {Component} from 'react'
import {connect} from 'react-redux'
import actions from '../action/'
import {
    View,
    Text,
    StyleSheet,
    Button,
} from 'react-native'

class FavoritePage extends Component {
    render() {
        const {navigation} = this.props
        return <View style={styles.welcome}>
            <Text>This is Favorite Page!</Text>
            <Button
                title={'改变主题颜色'}
                onPress={() => {
                    this.props.onThemeChange('green')
                }
                }
            />
        </View>
    }

}
const styles = StyleSheet.create({
    welcome: {
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center',
    }
})
const mapState = state => ({})
const mapDispatch = dispatch => ({
    onThemeChange: theme => dispatch(actions.onThemeChange(theme))
})
export default connect(mapState, mapDispatch)(FavoritePage)
